#ifndef HW_CV_TYPE_H
#define HW_CV_TYPE_H
    
#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

#pragma pack(8)
// 图像类型
typedef enum ImageType {
    // YUV planar U8 C3/2
    IMAGE_TYPE_YUV_NV12 = 0,  // NV12
    IMAGE_TYPE_YUV_NV21 = 1,  // NV21

    // U8 C3
    IMAGE_TYPE_RGB_PACKED = 10,   // RGB PACKED
    IMAGE_TYPE_RGB_PLANAR = 11,   // RGB PLANAR
    IMAGE_TYPE_BGR_PACKED = 12,   // BGR PACKED
    IMAGE_TYPE_BGR_PLANAR = 13,   // BGR PLANAR

    // encoded
    IMAGE_TYPE_JPEG = 30,   // jpeg
    IMAGE_TYPE_H264 = 31,   // H264
    IMAGE_TYPE_H265 = 32,   // H265

} ImageType;

typedef struct ImageInfo {
    int32_t width;              // image width
    int32_t height;             // image height
    int32_t widthStep;          // aligned width
    
    ImageType type;             // image type
    uint32_t dataLen;
    unsigned char *data;        // Image data
    uint64_t timeStamp;
    uint64_t frameIndex;        // FrameIndex
} ImageInfo;

// 定义点
typedef struct Point2d {
    int16_t x;
    int16_t y;
} Point2d;

typedef struct Size2d { 
    int16_t width;
    int16_t height;
} Size2d;

// 定义矩形结构体[
typedef struct RectInfo {
    int16_t x;        // 矩形左上顶点的x坐标
    int16_t y;        // 矩形左上顶点的y坐标
    int16_t width;    // 矩形宽
    int16_t height;   // 矩形高
} RectInfo;

typedef struct LandmarkInfo {
    int16_t x0;
    int16_t y0;
    int16_t x1;
    int16_t y1;
    int16_t x2;
    int16_t y2;
    int16_t x3;
    int16_t y3;
} LandmarkInfo;

typedef enum ClassType {
    // VEH
    CLASS_TYPE_BACK,            // 背景
    CLASS_TYPE_CAR,             // 小轿车

    // PED
    CLASS_TYPE_CYCLIST,         // 骑行目标
    CLASS_TYPE_PEDESTRAIN,      // 目标整体
    CLASS_TYPE_FACE,            // 目标

    // DOG        
    CLASS_TYPE_DOG,             // 狗
} ClassType;

typedef struct ObjBox {
    RectInfo rect;
    LandmarkInfo landmark;
    float fScore;
    int enClass;
} ObjBox;

#pragma pack()

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif